<!doctype html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport"
        content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
  <meta http-equiv="X-UA-Compatible" content="ie=edge">
  <title>编写位置</title>
  <!-- 延迟执行: 优先加载页面dom结构, js不阻塞页面渲染过程-->
  <script defer src="./scripts/index.js"></script>
  <script type="text/javascript">
    console.log('abc')
  </script>
</head>
<body>
js编写位置
<hr>

<button id="btn" onclick="alert(123)">click me</button>
<hr>
<!-- href属性, 可以解释执行js代码 -->
<a href="javascript: alert('href');">alert('href')</a>
<hr>
<a href="javascript:void(0)">;;;</a>
</body>
</html>